<?php
/**
 * author      :chenwenwen
 * createTime  :2020-04-05 22:09
 * description :
 */
namespace app\common\model\mysql;
use think\Model;

class Demo extends Model{
    public function getDemoByCategoryId($category_id,$limit = 10) {
        if(empty($category_id)) return [];
        $results = $this->where('category_id',$category_id)
            ->order('id','desc')
            ->limit($limit)
            ->select()->toArray();
        return $results;
    }
}